v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
LocationCustomAttributes

CreateLocationCustomAttributeDefinition

Creates a location-related custom attribute definition for a Square seller account. Use this endpoint to define a custom attribute that can be associated with locations. A custom attribute definition specifies the key, visibility, schema, and other properties for a custom attribute. After the definition is created, you can call UpsertLocationCustomAttribute or BulkUpsertLocationCustomAttributes to set the custom attribute for locations.

post/v2/locations/custom-attribute-definitions

Request body

idempotency_keystring

A unique identifier for this request, used to ensure idempotency. For more information, see Idempotency.

Example request

{
  "custom_attribute_definition": {
    "description": "Bestselling item at location",
    "key": "bestseller",
    "name": "Bestseller",
    "schema": {
      "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
    },
    "visibility": "VISIBILITY_READ_WRITE_VALUES"
  }
}

Response

Success

Example response

{
  "custom_attribute_definition": {
    "created_at": "2022-12-02T19:06:36.559Z",
    "description": "Bestselling item at location",
    "key": "bestseller",
    "name": "Bestseller",
    "schema": {
      "$ref": "https://developer-production-s.squarecdn.com/schemas/v1/common.json#squareup.common.String"
    },
    "updated_at": "2022-12-02T19:06:36.559Z",
    "version": 1,
    "visibility": "VISIBILITY_READ_WRITE_VALUES"
  }
}