Square: Merchant custom attributes schemas
19 Square schemas with complete fields and constraints.
← Merchant custom attributes operations · All schemas
Bulk Delete Merchant Custom Attributes — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) request. |
values | object | Required within parent | The data used to update the `CustomAttribute` objects. The keys must be unique and are used to map to the corresponding response. Additional keys: see wildcard field |
values.* | Model | Additional keys | Expand Bulk Delete Merchant Custom Attributes — request body — body values value |
Referenced models: Bulk Delete Merchant Custom Attributes — request body — body values value
Bulk Delete Merchant Custom Attributes — request body — body values value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) request. An individual request contains an optional ID of the associated custom attribute definition and optional key of the associated custom attribute definition. |
key | string | Optional | The key of the associated custom attribute definition. Represented as a qualified key if the requesting app is not the definition owner. Pattern: ^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$ |
merchant_id | string | Optional | The merchant whose attribute is deleted. |
Bulk Delete Merchant Custom Attributes — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) response, which contains a map of responses that each corresponds to an individual delete request. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
values | object | Required within parent | A map of responses that correspond to individual delete requests. Each response has the same key as the corresponding request. Additional keys: see wildcard field |
values.* | Model | Additional keys | Expand Bulk Delete Merchant Custom Attributes — response body — values value |
Referenced models: Bulk Delete Merchant Custom Attributes — response body — values value, Get Shift — response body — errors item
Bulk Delete Merchant Custom Attributes — response body — values value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkDeleteMerchantCustomAttributes) request. |
errors | array | Optional | Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item
Bulk Upsert Merchant Custom Attributes — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) request. |
values | object | Required within parent | A map containing 1 to 25 individual upsert requests. For each request, provide an arbitrary ID that is unique for this `BulkUpsertMerchantCustomAttributes` request and the information needed to create or update a custom attribute. Additional keys: see wildcard field |
values.* | Model | Additional keys | Expand Bulk Upsert Merchant Custom Attributes — request body — body values value |
Referenced models: Bulk Upsert Merchant Custom Attributes — request body — body values value
Bulk Upsert Merchant Custom Attributes — request body — body values value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) request. An individual request contains a merchant ID, the custom attribute to create or update, and an optional idempotency key. |
custom_attribute | Model | Required within parent | Expand Upsert Order Custom Attribute — request body — body custom attribute The custom attribute to create or update, with following fields: - `key`. This key must match the `key` of a custom attribute definition in the Square seller account. If the requesting application is not the definition owner, you must provide the qualified key. - `value`. This value must conform to the `schema` specified by the definition. For more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). - The version field must match the current version of the custom attribute definition to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) If this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error. |
idempotency_key | JSON | Optional | |
idempotency_key (anyOf 1) | string | Alternative | A unique identifier for this individual upsert request, used to ensure idempotency. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). Maximum length: 45 |
idempotency_key (anyOf 2) | null | Alternative | |
merchant_id | string | Required within parent | The ID of the target [merchant](entity:Merchant). Minimum length: 1 |
Referenced models: Upsert Order Custom Attribute — request body — body custom attribute
Bulk Upsert Merchant Custom Attributes — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) response, which contains a map of responses that each corresponds to an individual upsert request. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
values | object | Optional | A map of responses that correspond to individual upsert requests. Each response has the same ID as the corresponding request and contains either a `merchant_id` and `custom_attribute` or an `errors` field. Additional keys: see wildcard field |
values.* | Model | Additional keys | Expand Bulk Upsert Merchant Custom Attributes — response body — values value |
Referenced models: Bulk Upsert Merchant Custom Attributes — response body — values value, Get Shift — response body — errors item
Bulk Upsert Merchant Custom Attributes — response body — values value
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-BulkUpsertMerchantCustomAttributes) operation. |
custom_attribute | Model | Optional | Expand Upsert Order Custom Attribute — response body — custom attribute The new or updated custom attribute. |
errors | array | Optional | Any errors that occurred while processing the individual request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
merchant_id | string | Optional | The ID of the merchant associated with the custom attribute. |
Referenced models: Upsert Order Custom Attribute — response body — custom attribute, Get Shift — response body — errors item
Create Merchant Custom Attribute Definition — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) request. |
custom_attribute_definition | Model | Required within parent | Expand Create Order Custom Attribute Definition — request body — body custom attribute definition The custom attribute definition to create. Note the following: - With the exception of the `Selection` data type, the `schema` is specified as a simple URL to the JSON schema definition hosted on the Square CDN. For more information, including supported values and constraints, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). - `name` is required unless `visibility` is set to `VISIBILITY_HIDDEN`. |
idempotency_key | string | Optional | A unique identifier for this request, used to ensure idempotency. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). Maximum length: 45 |
Referenced models: Create Order Custom Attribute Definition — request body — body custom attribute definition
Create Merchant Custom Attribute Definition — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [CreateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-CreateMerchantCustomAttributeDefinition) response. Either `custom_attribute_definition` or `errors` is present in the response. |
custom_attribute_definition | Model | Optional | Expand Create Order Custom Attribute Definition — response body — custom attribute definition The new custom attribute definition. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Order Custom Attribute Definition — response body — custom attribute definition, Get Shift — response body — errors item
Delete Merchant Custom Attribute — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [DeleteMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-DeleteMerchantCustomAttribute) response. Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Get Shift — response body — errors item
List Merchant Custom Attribute Definitions — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [ListMerchantCustomAttributeDefinitions](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributeDefinitions) response. Either `custom_attribute_definitions`, an empty object, or `errors` is present in the response. If additional results are available, the `cursor` field is also present along with `custom_attribute_definitions`. |
cursor | string | Optional | The cursor to provide 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](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
custom_attribute_definitions | array | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`). |
custom_attribute_definitions[] | Model | Each item | Expand Create Order Custom Attribute Definition — response body — custom attribute definition |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Order Custom Attribute Definition — response body — custom attribute definition, Get Shift — response body — errors item
List Merchant Custom Attributes — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [ListMerchantCustomAttributes](api-endpoint:MerchantCustomAttributes-ListMerchantCustomAttributes) response. Either `custom_attributes`, an empty object, or `errors` is present in the response. If additional results are available, the `cursor` field is also present along with `custom_attributes`. |
cursor | string | Optional | 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](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
custom_attributes | array | Optional | The retrieved custom attributes. If `with_definitions` was set to `true` in the request, the custom attribute definition is returned in the `definition` field of each custom attribute. If no custom attributes are found, Square returns an empty object (`{}`). |
custom_attributes[] | Model | Each item | Expand Upsert Order Custom Attribute — response body — custom attribute |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Upsert Order Custom Attribute — response body — custom attribute, Get Shift — response body — errors item
Retrieve Merchant Custom Attribute Definition — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [RetrieveMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttributeDefinition) response. Either `custom_attribute_definition` or `errors` is present in the response. |
custom_attribute_definition | Model | Optional | Expand Create Order Custom Attribute Definition — response body — custom attribute definition The retrieved custom attribute definition. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Order Custom Attribute Definition — response body — custom attribute definition, Get Shift — response body — errors item
Retrieve Merchant Custom Attribute — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a [RetrieveMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-RetrieveMerchantCustomAttribute) response. Either `custom_attribute_definition` or `errors` is present in the response. |
custom_attribute | Model | Optional | Expand Upsert Order Custom Attribute — response body — custom attribute The retrieved custom attribute. If `with_definition` was set to `true` in the request, the custom attribute definition is returned in the `definition` field. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Upsert Order Custom Attribute — response body — custom attribute, Get Shift — response body — errors item
Update Merchant Custom Attribute Definition — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) request. |
custom_attribute_definition | Model | Required within parent | Expand Create Order Custom Attribute Definition — request body — body custom attribute definition The custom attribute definition that contains the fields to update. This endpoint supports sparse updates, so only new or changed fields need to be included in the request. Only the following fields can be updated: - `name` - `description` - `visibility` - `schema` for a `Selection` data type. Only changes to the named options or the maximum number of allowed selections are supported. For more information, see [Update a merchant custom attribute definition](https://developer.squareup.com/docs/merchant-custom-attributes-api/custom-attribute-definitions#update-custom-attribute-definition). The version field must match the current version of the custom attribute definition to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) If this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error. |
idempotency_key | JSON | Optional | |
idempotency_key (anyOf 1) | string | Alternative | A unique identifier for this request, used to ensure idempotency. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). Maximum length: 45 |
idempotency_key (anyOf 2) | null | Alternative |
Referenced models: Create Order Custom Attribute Definition — request body — body custom attribute definition
Update Merchant Custom Attribute Definition — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an [UpdateMerchantCustomAttributeDefinition](api-endpoint:MerchantCustomAttributes-UpdateMerchantCustomAttributeDefinition) response. Either `custom_attribute_definition` or `errors` is present in the response. |
custom_attribute_definition | Model | Optional | Expand Create Order Custom Attribute Definition — response body — custom attribute definition The updated custom attribute definition. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Create Order Custom Attribute Definition — response body — custom attribute definition, Get Shift — response body — errors item
Upsert Merchant Custom Attribute — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) request. |
custom_attribute | Model | Required within parent | Expand Upsert Order Custom Attribute — request body — body custom attribute The custom attribute to create or update, with the following fields: - `value`. This value must conform to the `schema` specified by the definition. For more information, see [Supported data types](https://developer.squareup.com/docs/devtools/customattributes/overview#supported-data-types). - The version field must match the current version of the custom attribute definition to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) If this is not important for your application, version can be set to -1. For any other values, the request fails with a BAD_REQUEST error. |
idempotency_key | JSON | Optional | |
idempotency_key (anyOf 1) | string | Alternative | A unique identifier for this request, used to ensure idempotency. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). Maximum length: 45 |
idempotency_key (anyOf 2) | null | Alternative |
Referenced models: Upsert Order Custom Attribute — request body — body custom attribute
Upsert Merchant Custom Attribute — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an [UpsertMerchantCustomAttribute](api-endpoint:MerchantCustomAttributes-UpsertMerchantCustomAttribute) response. Either `custom_attribute_definition` or `errors` is present in the response. |
custom_attribute | Model | Optional | Expand Upsert Order Custom Attribute — response body — custom attribute The new or updated custom attribute. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
Referenced models: Upsert Order Custom Attribute — response body — custom attribute, Get Shift — response body — errors item