BulkUpsertLocationCustomAttributes
Creates or updates custom attributes for locations as a bulk operation. Use this endpoint to set the value of one or more custom attributes for one or more locations. A custom attribute is based on a custom attribute definition in a Square seller account, which is created using the CreateLocationCustomAttributeDefinition endpoint. This BulkUpsertLocationCustomAttributes endpoint accepts a map of 1 to 25 individual upsert requests and returns a map of individual upsert responses. Each upsert request has a unique ID and provides a location ID and custom attribute. Each upsert response is returned with the ID of the corresponding request. To create or update a custom attribute owned by another application, the visibility setting must be VISIBILITY_READ_WRITE_VALUES.
Request body
Example request
{
"values": {
"id1": {
"custom_attribute": {
"key": "bestseller",
"value": "hot cocoa"
},
"location_id": "L0TBCBTB7P8RQ"
},
"id2": {
"custom_attribute": {
"key": "bestseller",
"value": "berry smoothie"
},
"location_id": "L9XMD04V3STJX"
},
"id3": {
"custom_attribute": {
"key": "phone-number",
"value": "+12223334444"
},
"location_id": "L0TBCBTB7P8RQ"
}
}
}Response
Success
Example response
{
"values": {
"id1": {
"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"
},
"location_id": "L0TBCBTB7P8RQ"
},
"id2": {
"custom_attribute": {
"created_at": "2023-01-09T19:02:58.647Z",
"key": "bestseller",
"updated_at": "2023-01-09T19:21:04.551Z",
"value": "berry smoothie",
"version": 1,
"visibility": "VISIBILITY_READ_WRITE_VALUES"
},
"location_id": "L9XMD04V3STJX"
},
"id3": {
"custom_attribute": {
"created_at": "2023-01-09T19:04:57.985Z",
"key": "phone-number",
"updated_at": "2023-01-09T19:21:04.563Z",
"value": "+12239903892",
"version": 2,
"visibility": "VISIBILITY_READ_WRITE_VALUES"
},
"location_id": "L0TBCBTB7P8RQ"
}
}
}