v1

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

RetrieveLocationCustomAttribute

Retrieves a custom attribute associated with a location. You can use the with_definition query parameter to also retrieve the custom attribute definition in the same call. To retrieve a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_ONLY or VISIBILITY_READ_WRITE_VALUES.

get/v2/locations/{location_id}/custom-attributes/{key}

Path parameters

location_idstring required

The ID of the target location.

keystring required

The key of the custom attribute to retrieve. 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 use the qualified key.

Query parameters

with_definitionboolean

Indicates whether to return the custom attribute definition in the definition field of the custom attribute. Set this parameter to true to get the name and description of the custom attribute, information about the data type, or other definition details. The default value is false.

versioninteger

The current version of the custom attribute, 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 BAD_REQUEST error.

Response

Success

Example response

{
  "custom_attribute": {
    "created_at": "2023-01-09T19:02:58.647Z",
    "key": "bestseller",
    "updated_at": "2023-01-09T19:21:04.551Z",
    "value": "hot cocoa",
    "version": 2,
    "visibility": "VISIBILITY_READ_WRITE_VALUES"
  }
}